<script lang="ts" setup>
import wangEditor from './wangEditor';
import { nextTick } from 'vue';

interface Props {
  height?: number;
  modelValue: string;
}
const props = withDefaults(defineProps<Props>(), {
  height: 300,
  modelValue: ''
});

const emit = defineEmits(['update:modelValue']);
nextTick(() => {
  new wangEditor(
    '#editor',
    (newHtml: string) => {
      emit('update:modelValue', newHtml);
    },
    props
  );
});
</script>
<template>
  <div id="editor"></div>
</template>
<style lang="scss" scoped></style>
